package com.hanoiwiki.manager.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.hanoiwiki.dao.UserEvaluationDAO;
import com.hanoiwiki.exception.DataAccessException;
import com.hanoiwiki.manager.UserEvaluationManager;
import com.hanoiwiki.model.UserEvaluation;

@Component
@Transactional
public class UserEvaluationManagerImpl extends BaseManagerImpl implements UserEvaluationManager{

	@Autowired
	private UserEvaluationDAO evaluationDAO;
	
	@Override
	public void save(UserEvaluation userEvaluation) {
		try {
			evaluationDAO.save(userEvaluation);
		} catch (DataAccessException e) {
			log.error("",e);
		}
	}

	@Override
	public void update(UserEvaluation userEvaluation) {
		try {
			evaluationDAO.update(userEvaluation);
		} catch (DataAccessException e) {
			log.error("",e);
		}
	}

	@Override
	public UserEvaluation get(Integer id) {
		try {
			return evaluationDAO.get(id);
		} catch (DataAccessException e) {
			log.error("",e);
		}
		return null;
	}

	@Override
	public List<UserEvaluation> getList() {
		try {
			return evaluationDAO.getList();
		} catch (DataAccessException e) {
			log.error("",e);
		}
		return null;
	}

	@Override
	public void remove(Integer id) {
		try {
			evaluationDAO.remove(id);
		} catch (DataAccessException e) {
			log.error("",e);
		}
		
	}

}
